Skip to content

Python: Update query help references to Python 3 - #23203

Open
SkyCipherr wants to merge 1 commit into
github:mainfrom
SkyCipherr:codex/update-python-query-help-references
Open

SkyCipherr wants to merge 1 commit into
github:mainfrom
SkyCipherr:codex/update-python-query-help-references

Conversation

@SkyCipherr

Copy link
Copy Markdown
Contributor

Update 85 references in 61 Python query-help files to the equivalent Python 3 documentation. Some sections have moved, so the patch uses their current anchors. References that explain Python 2-specific behavior, such as old-style classes, apply, and the print statement, still point to the historical documentation.

Verified the HTTP response and fragment targets for all 44 distinct replacement URLs. Rendered all 61 changed pages with codeql generate query-help --format=markdown and checked the rendered links.

Fixes #18775.

@SkyCipherr
SkyCipherr requested a review from a team as a code owner November 23, 2026 06:11
Copilot AI adaptive review requested due to automatic review settings November 23, 2026 06:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Three active documentation findings remain: Python 2-specific references in the affected query help incorrectly point to Python 3 documentation, creating duplicate or non-supporting links.

3 open issues
What changed in this PR

Updates Python query-help documentation references from legacy Python 2 URLs to corresponding Python 3 documentation, including current section anchors, while retaining historical links for Python 2-specific behavior.

Changes:

  • Refreshes language-reference, tutorial, standard-library, glossary, and FAQ links across 61 query-help files.
  • Updates moved documentation anchors and obsolete HTTP URLs.
  • Preserves references for Python 2-specific constructs such as old-style classes, apply, and the print statement.
File Description
python/​ql/​src/​Variables/​UnusedModuleVariable.qhelp Updates module and import tutorial references.
python/​ql/​src/​Variables/​UnusedLocalVariable.qhelp Updates the assignment-statement reference.
python/​ql/​src/​Variables/​UninitializedLocal.qhelp Updates FAQ and global-statement references.
python/​ql/​src/​Variables/​UndefinedGlobal.qhelp Updates the modules tutorial reference.
python/​ql/​src/​Variables/​UndefinedExport.qhelp Updates import and package-import references.
python/​ql/​src/​Variables/​ShadowBuiltin.qhelp Updates built-in functions and types references.
python/​ql/​src/​Variables/​LeakingListComprehension.qhelp Updates list-comprehension references.
python/​ql/​src/​Statements/​UnnecessaryPass.qhelp Updates the pass statement reference.
python/​ql/​src/​Statements/​UnnecessaryElseClause.qhelp Updates loop and else-clause references.
python/​ql/​src/​Statements/​UnnecessaryDelete.qhelp Updates del and reference-counting references.
python/​ql/​src/​Statements/​TopLevelPrint.qhelp Updates the modules tutorial reference while retaining the Python 2 print reference.
python/​ql/​src/​Statements/​SideEffectInAssert.qhelp Updates the assert-statement reference.
python/​ql/​src/​Statements/​NonIteratorInForLoop.qhelp Updates the iterator protocol reference.
python/​ql/​src/​Statements/​NestedLoopsSameVariableWithReuse.qhelp Updates for-statement references.
python/​ql/​src/​Statements/​NestedLoopsSameVariable.qhelp Updates for-statement references.
python/​ql/​src/​Statements/​ModificationOfLocals.qhelp Updates for-statement references.
python/​ql/​src/​Statements/​MismatchInMultipleAssignment.qhelp Updates assignment and introductory tutorial references.
python/​ql/​src/​Statements/​IterableStringOrSequence.qhelp Updates iterator protocol references.
python/​ql/​src/​Statements/​C_StyleParentheses.qhelp Updates the grammar specification reference.
python/​ql/​src/​Statements/​BreakOrReturnInFinally.qhelp Updates try, break, and return references.
python/​ql/​src/​Statements/​AssertOnTuple.qhelp Updates the assert-statement reference.
python/​ql/​src/​Statements/​AssertLiteralConstant.qhelp Updates assert and compiled-file references.
python/​ql/​src/​Security/​CWE-776/​XmlBomb.qhelp Updates XML security documentation.
python/​ql/​src/​Security/​CWE-611/​Xxe.qhelp Updates XML security documentation.
python/​ql/​src/​Metrics/​TransitiveImports.qhelp Updates the import-statement reference.
python/​ql/​src/​Metrics/​FNumberOfTests.qhelp Updates the doctest reference.
python/​ql/​src/​Metrics/​FFunctionsAndMethods.qhelp Updates the function-definition reference.
python/​ql/​src/​Metrics/​FClasses.qhelp Updates the class-definition reference.
python/​ql/​src/​Metrics/​DirectImports.qhelp Updates the import-statement reference.
python/​ql/​src/​Imports/​UnintentionalImport.qhelp Updates import and modules references.
python/​ql/​src/​Imports/​ModuleLevelCyclicImport.qhelp Updates import and modules references.
python/​ql/​src/​Imports/​ModuleImportsItself.qhelp Updates the modules tutorial reference.
python/​ql/​src/​Imports/​ImportStarUsed.qhelp Updates the import-statement reference.
python/​ql/​src/​Imports/​Imports.qhelp Updates the import-statement reference.
python/​ql/​src/​Imports/​ImportandImportFrom.qhelp Updates the import-statement reference.
python/​ql/​src/​Imports/​FromImportOfMutableAttribute.qhelp Updates import and modules references.
python/​ql/​src/​Imports/​CyclicImport.qhelp Updates import and modules references.
python/​ql/​src/​Functions/​ReturnValueIgnored.qhelp Updates the function-definition reference.
python/​ql/​src/​Functions/​ReturnConsistentTupleSizes.qhelp Updates the function-definition reference.
python/​ql/​src/​Functions/​NonSelf.qhelp Updates the classes tutorial reference.
python/​ql/​src/​Functions/​NonCls.qhelp Updates the classes tutorial reference.
python/​ql/​src/​Functions/​ExplicitReturnInInit.qhelp Updates the __init__ reference.
python/​ql/​src/​Expressions/​WrongNumberArgumentsInCall.qhelp Updates argument and parameter references.
python/​ql/​src/​Expressions/​WrongNameForArgumentInCall.qhelp Updates argument and parameter references.
python/​ql/​src/​Expressions/​UnnecessaryLambda.qhelp Updates the lambda-expression reference.
python/​ql/​src/​Expressions/​NonPortableComparisonUsingIs.qhelp Updates the comparison reference.
python/​ql/​src/​Expressions/​NonCallableCalled.qhelp Updates callable and __call__ references.
python/​ql/​src/​Expressions/​HashedButNoHash.qhelp Updates the set-types reference.
python/​ql/​src/​Expressions/​Formatting/​WrongNumberArgumentsFor3101Format.qhelp Updates string-format syntax documentation.
python/​ql/​src/​Expressions/​Formatting/​WrongNameInArgumentsFor3101Format.qhelp Updates string-format syntax documentation.
python/​ql/​src/​Expressions/​Formatting/​UnusedNamedArgumentIn3101Format.qhelp Updates string-format syntax documentation.
python/​ql/​src/​Expressions/​Formatting/​UnusedArgumentIn3101Format.qhelp Updates string-format syntax documentation.
python/​ql/​src/​Expressions/​Formatting/​MixedExplicitImplicitIn3101Format.qhelp Updates string-format syntax documentation.
python/​ql/​src/​Expressions/​Comparisons/​UselessComparisonTest.qhelp Updates the comparison reference.
python/​ql/​src/​Expressions/​CompareIdenticalValuesMissingSelf.qhelp Updates the comparison reference.
python/​ql/​src/​Expressions/​CompareIdenticalValues.qhelp Updates comparison and numeric-library references.
python/​ql/​src/​Expressions/​CompareConstants.qhelp Updates the comparison reference.
python/​ql/​src/​Classes/​WrongNumberArgumentsInClassInstantiation.qhelp Updates argument, parameter, and class references.
python/​ql/​src/​Classes/​WrongNameForArgumentInClassInstantiation.qhelp Updates argument, parameter, and class references.
python/​ql/​src/​Classes/​ShouldBeContextManager.qhelp Updates context-manager documentation.
python/​ql/​src/​Classes/​ConflictingAttributesInBaseClasses.qhelp Updates the data-model reference.

Review effort: Lite (adaptive)

<li>
Python 2 standard library:
<a href="https://docs.python.org/2/library/xml.html#xml-vulnerabilities">XML Vulnerabilities</a>.
<a href="https://docs.python.org/3/library/xml.html#xml-security">XML Vulnerabilities</a>.
<li>
Python 2 standard library:
<a href="https://docs.python.org/2/library/xml.html#xml-vulnerabilities">XML Vulnerabilities</a>.
<a href="https://docs.python.org/3/library/xml.html#xml-security">XML Vulnerabilities</a>.
Comment on lines +36 to +38
<li>Python Tutorial: <a href="https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions">List Comprehensions</a>.</li>
<li>The History of Python: <a href="http://python-history.blogspot.co.uk/2010/06/from-list-comprehensions-to-generator.html">From List Comprehensions to Generator Expressions</a>.</li>
<li>Python Language Reference: <a href="https://docs.python.org/2/reference/expressions.html#list-displays">List displays</a>.</li>
<li>Python Language Reference: <a href="https://docs.python.org/3/reference/expressions.html#list-displays">List displays</a>.</li>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Python] QHelp references old-ish python 2 documentation

2 participants